package com.fbt.transfer.app.driver.model;

import com.fbt.transfer.app.driver.util.Constants;
import lombok.Getter;

/**
 * @author tuocoo
 * @date 2025年03月27日20时20分36秒/20:20
 */
@Getter
public enum ServiceType {
  /** 经济型 */
  ECONOMICS("ECONOMICS", "经济型", 1),
  COMFORT("COMFORT", "舒适型", 2),
  LUXUR("LUXUR", "豪华型", 3),
  BUSINESS("BUSINESS", "商务型", 4),
  ;
  private final String value;
  private final String desc;
  private final int order;

  ServiceType(String value, String desc, int order) {
    this.value = value;
    this.desc = desc;
    this.order = order;
  }

  public static String getByDesc(String desc) {
    for (ServiceType serviceType : ServiceType.values()) {
      if (serviceType.getDesc().contains(desc)) {
        return serviceType.getValue();
      }
    }
    return null;
  }

  public static String[] all() {
    return new String[] {
      Constants.ALL, ECONOMICS.getDesc(), COMFORT.getDesc(), LUXUR.getDesc(), BUSINESS.getDesc(),
    };
  }
}
